-
Notifications
You must be signed in to change notification settings - Fork 44
Add tests for flowable engine #1720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
JIRA:LMCROSSITXSADEPLOY-3320
...src/test/java/org/cloudfoundry/multiapps/controller/process/flowable/FlowableEngineTest.java
Outdated
Show resolved
Hide resolved
...src/test/java/org/cloudfoundry/multiapps/controller/process/flowable/FlowableEngineTest.java
Outdated
Show resolved
Hide resolved
| configuration.setDefaultMailClient(flowableMailClient); | ||
| configuration.setDatabaseSchemaUpdate("create-drop"); | ||
| configuration.setBeans(Map.of("testVariableTask", testVariableTask)); | ||
| configuration.setAsyncExecutorActivate(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the async executor turned off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was generated by the chat in order to keep the test single threaded but even when this line is removed, the test is still single thread. So we can remove this configuration.
...src/test/java/org/cloudfoundry/multiapps/controller/process/flowable/FlowableEngineTest.java
Outdated
Show resolved
Hide resolved
...src/test/java/org/cloudfoundry/multiapps/controller/process/flowable/FlowableEngineTest.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Test | ||
| void testProcessWithPredefinedVariables() { | ||
| String correlationId = UUID.randomUUID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of boilerplate for building test data (createBigDeploymentDescriptor, etc.) makes the class huge.
Suggestion: extract TestFixtures (factory classes or builders) into a separate test utility
...src/test/java/org/cloudfoundry/multiapps/controller/process/flowable/FlowableEngineTest.java
Show resolved
Hide resolved
| // This assertion intentionally checks that the modified deployment descriptor is different from the initially set one because of flowable caching regression | ||
| // https://github.com/flowable/flowable-engine/issues/4130 | ||
| // The original behaviour must be to have same deployment descriptor as it was set in the task. Modify the test to assert for matching values when the issue is fixed. | ||
| assertNotEquals(JsonUtil.toJson(modifiedBigDeploymentDescriptor), JsonUtil.toJson(retrievedBigDeploymentDescriptor)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is odd, why do we need to create a test case to check a bug/regression, do you think that we can add it with assertEquals and comment it until a fix is provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will remind us to fix the test when new version of flowable is adopted and fix is available and also remove custom added workaround in FlowableConfiguration class.
| Map<String, Object> initialVariables = new HashMap<>(); | ||
| setSerializedValueInMap(initialVariables, Variables.CORRELATION_ID, correlationId); | ||
| setSerializedValueInMap(initialVariables, Variables.DELETE_SERVICES, deleteServices); | ||
| setSerializedValueInMap(initialVariables, Variables.MTA_ID, mtaId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core logic of the tests is ~20 lines you may think of extracting the assertions and the setup in separate utilities for more readable tests.
|


No description provided.